<!-- @author zhengjie -->
<template>
  <div class="">

    <!-- 侧边导航++++++++++++++++++++++ -->
    <el-menu :default-active="defaultActive" class=" mt_20 ml_20 elmenu " background-color="#fff" text-color="#000000"
      active-text-color="#000000">

      <!-- <div class="space-between center" style="padding: 20px;">
        <div class="row center">
          <img style="width: 34px;height: 34px;margin-right: 20px;" :src="game_logo" />
          <div class="f_14">{{game_name}}</div>
        </div>

        <img class="cursor" style="width: 16px;height: 12px;" src="@/assets/images/jtzy.png" @click="toUrl('/mine')" />
      </div> -->



      <!--    <el-menu-item index="1" class="item_nav" @click="toUrl('/mine')">
        <i class="el-icon-s-home"></i>
        <span slot="title">首页</span>
      </el-menu-item> -->

      <div class="row back center" @click="toUrl('/mine')">
        <img style="width: 22px;height: 18px;" src="@/assets//images/jt.png" />
        <!-- <img style="width: 22px;height: 18px;" src= "file:///D:/phpstudy_pro/WWW/sc-pcc/src/assets/images/jt.bmp" /> -->


        <div class="  cursor ml_5">返回</div>
      </div>





      <el-submenu index="3" class="item_nav mt_10">
        <template slot="title">
          <img style="height: 20px;width: 20px;margin-right: 10px;" src="@/assets/images/zll.png" />
          <span>申请测试环境</span>
        </template>
        <el-menu-item index="3-1" @click="toUrl('/mine/databaseCon')">数据库配置</el-menu-item>
        <el-menu-item index="3-2" @click="toUrl('/mine/toolCon')">工具服配置</el-menu-item>

      </el-submenu>








    </el-menu>
    <!-- 侧边导航=============== -->
  </div>
</template>

<script>
  import {
    getToken,
    setToken,
    removeToken
  } from '@/utils/auth'
  export default {
    name: 'Sidebar',

    props: {
      defaultActive: {
        type: String,
        default: '4-1'
      },

    },
    data() {
      return {
        game_id: '',
        game_name: '',
        game_logo: '',

      }
    },
    created() {

      this.game_id = localStorage.getItem('game_id')
      this.game_name = localStorage.getItem('game_name')
      this.game_logo = localStorage.getItem('game_logo')

    },
    methods: {
      handleOpen(key, keyPath) {
        console.log(key, keyPath);
      },
      handleClose(key, keyPath) {
        console.log(key, keyPath);
      },

      handleClick(command) {
        var token = getToken();
        if (!token) {
          this.$message({
            message: '请先登录',
            type: 'warning'
          });
        }
        // this.$message('click on item ' + command);
        if (command == 'a') {
          this.toUrl('/mine/PersonalCertificate')
        }

        if (command == 'd') {
          this.toUrl('/mine/gameConfiguration')
        }



      },
      toUrl(url) {
        console.log('navv', url)

        this.$router.push({
          path: url
        })
      },


      childMethod() {
        this.$parent.fatherMethod();
      }

    }
  }
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
  .back {
    margin-top: 10px;
    margin-left: 20px;

    width: 100px;
    height: 36px;
    background: #409EFF;
    border-radius: 6px;

    font-size: 16px;
    font-family: Source Han Sans SC;
    font-weight: bold;
    color: #FDFEFF;
  }

  .elmenu {
    border-radius: 10px;
    padding-top: 20px;
    height: 880px;
  }

  ::v-deep .el-submenu__title {
    font-size: 18px;
  }

  ::v-deep .el-menu-item.is-active {
    background: #779EFE !important;

  }

  ::v-deep .el-menu-item * {
    font-size: 18px;

  }

  ::v-deep .el-menu-item.is-active {
    background: #779EFE !important;

  }
</style>
